Following up on my unsuccessful attemp to combine two forms in a single page, I tried to understand how this works but I still don't get it. The following code is part of vokuro example.
How do I include a form, that is normally access through session/login
, in to indexcontroller.php? so instead of clicking on a link to login, I want it to be displayed on the index page. I do not want to copy paste the contents of session controller login action as I want to be able to access session/login also.
I've followed the example on Phalcon\Forms
I set up dependency injector in services.php as:
$di['forms'] = function() {
return new Phalcon\Forms\Manager();
};
then in indexcontroller.php I added:
$this->forms->set('login', new LoginForm());
echo $this->forms->get('login')->render();
but I get
Wrong number of parameters
#0 C:\wamp\www\vokuro\app\controllers\IndexController.php(33): Phalcon\Forms\Form->render()
#1 [internal function]: Vokuro\Controllers\IndexController->indexAction()
#2 [internal function]: Phalcon\Dispatcher->dispatch()
#3 C:\wamp\www\vokuro\public\index.php(37): Phalcon\Mvc\Application->handle()
#4 {main}
I tried adding use Phalcon\Mvc\View\Simple;
to indexcontroller.php but that didn't help either. I feel like I understand how most of this work but when I attemp to use the example codes in the documentation, nothing works. What am I doing wrong?